<html>
<head><meta charset="utf-8"><title>stabilize const TypeId::of · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html">stabilize const TypeId::of</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="192970651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/192970651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#192970651">(Apr 05 2020 at 18:06)</a>:</h4>
<p>I'm interested in getting <code>const_type_id</code> stabilized. Are there any lingering concerns or blocking issues?</p>



<a name="193014005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193014005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193014005">(Apr 06 2020 at 09:09)</a>:</h4>
<p>not sure, is there anything left on the tracking issue?</p>



<a name="193014010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193014010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193014010">(Apr 06 2020 at 09:09)</a>:</h4>
<p>that's where we usually list concerns</p>



<a name="193029257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193029257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193029257">(Apr 06 2020 at 11:45)</a>:</h4>
<p>There isn't one for <code>const_type_id</code> specifically. The Unstable book links the Const Fn issue (<a href="https://github.com/rust-lang/rust/issues/57563" title="https://github.com/rust-lang/rust/issues/57563">#57563</a>) and the unstable attribute links <code>non_static_type_id</code> (<a href="https://github.com/rust-lang/rust/issues/41875" title="https://github.com/rust-lang/rust/issues/41875">#41875</a>), which is a separate change.</p>



<a name="193031032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193031032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193031032">(Apr 06 2020 at 12:04)</a>:</h4>
<p>I guess it's the big brother of <code>const_type_name</code>, so all concerns for that apply to <code>const_type_id</code>, too, maybe even more strongly.</p>



<a name="193031111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193031111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193031111">(Apr 06 2020 at 12:05)</a>:</h4>
<p>the tracking issue for that is <a href="https://github.com/rust-lang/rust/issues/63084" title="https://github.com/rust-lang/rust/issues/63084">https://github.com/rust-lang/rust/issues/63084</a></p>



<a name="193038132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193038132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193038132">(Apr 06 2020 at 13:05)</a>:</h4>
<p>So, basically, the team isn't willing to stabilize it as const because compiler versions will make it differ? Why is that any different? Still the same caveat, needs to be treated with the same caution.</p>



<a name="193038847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193038847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193038847">(Apr 06 2020 at 13:11)</a>:</h4>
<p>No, not because compiler versions will differ, that's a separate discussion that I think everyone is on the same page</p>



<a name="193038991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193038991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193038991">(Apr 06 2020 at 13:12)</a>:</h4>
<p>as far as I can tell, the issue is that you can make decisions about generic types without your ability to do so showing up as trait bounds</p>



<a name="193040734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193040734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193040734">(Apr 06 2020 at 13:25)</a>:</h4>
<p>I'm sorry, how do trait bounds matter for TypeId?</p>



<a name="193041488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193041488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193041488">(Apr 06 2020 at 13:30)</a>:</h4>
<p>it doesn't have a bound at all</p>



<a name="193041585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193041585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193041585">(Apr 06 2020 at 13:31)</a>:</h4>
<p>so a function like <code>mem::swap</code> could check if the type is <code>[u8; 16]</code> and do something different. although, there is the <code>'static</code> bound, for now :P. and specialization exists, it's just not stable</p>



<a name="193044271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193044271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193044271">(Apr 06 2020 at 13:52)</a>:</h4>
<p>I'm really lost now. How does any of this have to do with making <code>TypeId::of</code> const? The inner <code>u64</code> is already compile-time generated, and that's the only inner value... This has nothing to do with enforcing what people are doing with the values, just identifying them.</p>



<a name="193045022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045022">(Apr 06 2020 at 13:58)</a>:</h4>
<p>oh I remember now</p>



<a name="193045062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045062">(Apr 06 2020 at 13:58)</a>:</h4>
<p><span class="user-mention" data-user-id="252217">@Khionu Sybiern</span> <code>const fn</code>s cannot have trait bounds today</p>



<a name="193045095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045095">(Apr 06 2020 at 13:58)</a>:</h4>
<p>they're very limited on purpose</p>



<a name="193045180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045180">(Apr 06 2020 at 13:59)</a>:</h4>
<p><code>TypeId::of</code> <em>in a <code>const fn</code></em> (without <code>#![feature(const_fn)]</code>) lets you tell apart types which you can't today</p>



<a name="193045186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045186">(Apr 06 2020 at 13:59)</a>:</h4>
<p>ooof...</p>



<a name="193045196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045196">(Apr 06 2020 at 13:59)</a>:</h4>
<p>at least I think that's the argument</p>



<a name="193045227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045227">(Apr 06 2020 at 13:59)</a>:</h4>
<p>(it's not necessary a <em>good</em> argument for keeping <code>TypeId::of</code> unstable)</p>



<a name="193045607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045607">(Apr 06 2020 at 14:02)</a>:</h4>
<p>Dang. This is blocking me on making my API any kind of ergonomic without a DSL. Currently require a if/else if chains to try to cast an object...</p>



<a name="193045823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045823">(Apr 06 2020 at 14:03)</a>:</h4>
<p>hehe, your use case sounds like the very reason ppl are hesitant to stabilize it</p>



<a name="193045937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193045937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193045937">(Apr 06 2020 at 14:03)</a>:</h4>
<p>If Rust had better RTTI, I wouldn't be in this situation.</p>



<a name="193046053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046053">(Apr 06 2020 at 14:04)</a>:</h4>
<p>I have two options: associated type, which sets a hard restriction of one type, or try_cast'ing</p>



<a name="193046334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046334">(Apr 06 2020 at 14:06)</a>:</h4>
<p>I think if we had specialization your matching code would be the worst way to implement your library ;)</p>



<a name="193046434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046434">(Apr 06 2020 at 14:06)</a>:</h4>
<p>I gave up on Specialization being implemented in the near enough future, otherwise that would solve a lot of my problems</p>



<a name="193046442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046442">(Apr 06 2020 at 14:06)</a>:</h4>
<p>You'd just be able to implement a trait for all types, and specialize it for specific types</p>



<a name="193046654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046654">(Apr 06 2020 at 14:08)</a>:</h4>
<p>well, this feature is just crappy specialization on stilts if you use it as you describe it. And as I specified before, your use case is why people don't want to stabilize type id</p>



<a name="193046759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193046759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193046759">(Apr 06 2020 at 14:08)</a>:</h4>
<p>Honestly, I've considered diving off the unsafe cliff and start implementing my own type tracking. It's just so painful to try and do it in safe/stable Rust.</p>



<a name="193047011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193047011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193047011">(Apr 06 2020 at 14:10)</a>:</h4>
<p>Also, I don't actually think Specialization would help me here. User starts with a single root function that gets passed a state, context, and message. They should be able to branch based on what the message is and what their state is.</p>



<a name="193047399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193047399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193047399">(Apr 06 2020 at 14:13)</a>:</h4>
<p>This discussion is getting off topic. I don't think you'll be able to move the stabilization ahead with your use case as a motivating example. Rather the opposite, the fact that this is what you're trying to use it for is motivation for not stabilizing it.</p>



<a name="193047449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193047449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193047449">(Apr 06 2020 at 14:13)</a>:</h4>
<p>I may be severely misinterpreting the situation though</p>



<a name="193047930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193047930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193047930">(Apr 06 2020 at 14:16)</a>:</h4>
<p>The situation is that I'm trying to use TypeId to make my type erasure process more ergonomic. Maybe there's another solution, but I haven't been able to think of one, nor has anyone I've asked.</p>



<a name="193047989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193047989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193047989">(Apr 06 2020 at 14:17)</a>:</h4>
<p>What's the point of TypeId (const or no) if we're not supposed to be able to do runtime type evaluation?</p>



<a name="193048221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048221">(Apr 06 2020 at 14:18)</a>:</h4>
<p>I don't understand why this shouldn't be stabilized since we already have the function. It's stalemating because of a decision that was already made.</p>



<a name="193048295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048295">(Apr 06 2020 at 14:19)</a>:</h4>
<p>I get the technical reasons, but you're saying there's also language direction reasons</p>



<a name="193048355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048355">(Apr 06 2020 at 14:19)</a>:</h4>
<p>Yes, the keyword you're looking for in language jargon is "referential transparency"</p>



<a name="193048507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048507">(Apr 06 2020 at 14:20)</a>:</h4>
<p>but you're talking to the wrong person, I neither understand the implications nor believe that referential transparency is something that can be pursued reasonably in Rust</p>



<a name="193048541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048541">(Apr 06 2020 at 14:20)</a>:</h4>
<p>my belief may come from my lack of understanding, so...</p>



<a name="193048641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048641">(Apr 06 2020 at 14:21)</a>:</h4>
<p>My understanding is that there's a number of people that want Rust to have static purity, which does make sense for a number of reasons, but it also is harshly restrictive.</p>



<a name="193048885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193048885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Khionu Sybiern <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193048885">(Apr 06 2020 at 14:23)</a>:</h4>
<p>I'll drop this for now, I'll see if I can find other options</p>



<a name="193049041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/stabilize%20const%20TypeId%3A%3Aof/near/193049041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/stabilize.20const.20TypeId.3A.3Aof.html#193049041">(Apr 06 2020 at 14:24)</a>:</h4>
<p>You can always open a tracking issue for it, that will help move things forward (even if the direction is unknown)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>